Skip to content

[8.18] [Performance] Refactor TTFMP query from, to fields (#213911)#217091

Merged
awahab07 merged 7 commits intoelastic:8.18from
awahab07:backport/8.18/pr-213911
Apr 7, 2025
Merged

[8.18] [Performance] Refactor TTFMP query from, to fields (#213911)#217091
awahab07 merged 7 commits intoelastic:8.18from
awahab07:backport/8.18/pr-213911

Conversation

@awahab07
Copy link
Copy Markdown
Contributor

@awahab07 awahab07 commented Apr 3, 2025

Backport

This will backport the following commits from main to 8.18:

Questions ?

Please refer to the Backport tool documentation

Currently Kibana forwards `query_range_secs` and `query_offset_secs` to
mark the selected time range when reporting TTFMP event. This format
caused some challenges to identify `from`, `to` date offsets in
visualizations.

To simplify, the PR renames and sends the three fields explicitly:
- `query_from_offset_secs` offset to `0` (now), with -ve for past and
+ve for future dates
- `query_to_offset_secs` offset to `0` (now), with -ve for past and +ve
for future dates
- `query_range_secs`                      same as previously sent

_This approach is followed after a discussion, and based on the
[gist](https://gist.github.com/andrewvc/1f04a57a336d768e4ec5ff2eff06ba54)
excerpt:_

```
Earliest date -> QueryFrom
Newest date -> QueryTo
Duration -> QueryRange
```

### Indexing
These fields then should be mapped in the EBT indexer to ingest in the
top level of the document, eventually removing the need to create
runtime fields in data views for visualizations.

Also, runtime fields in data views should be updated to reflect this
change. For backward compatibility, the runtime fields can cater both
the old and new field names conditionally.

### Testing
- Ensure that the TTFMP events are correctly reporting the date ranges.

### Example

![image](https://github.com/user-attachments/assets/529507fc-66f7-440a-8bbb-b34176e8d093)

(cherry picked from commit e6e78ac)

# Conflicts:
#	src/core/packages/analytics/browser-internal/src/track_performance_measure_entries.test.ts
#	src/core/packages/analytics/browser-internal/src/track_performance_measure_entries.ts
#	src/platform/packages/shared/kbn-ebt-tools/src/performance_metrics/context/measure_interaction/index.ts
#	src/platform/packages/shared/kbn-ebt-tools/src/performance_metrics/context/measure_interaction/measure_interaction.test.tsx
@awahab07 awahab07 requested a review from kibanamachine as a code owner April 3, 2025 18:12
@awahab07 awahab07 added the backport This PR is a backport of another PR label Apr 3, 2025
@awahab07 awahab07 enabled auto-merge (squash) April 3, 2025 18:12
@botelastic botelastic bot added the Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation. label Apr 4, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

History

@awahab07 awahab07 requested a review from a team April 7, 2025 09:50
Copy link
Copy Markdown
Contributor

@kpatticha kpatticha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@awahab07 awahab07 merged commit 1ffaddb into elastic:8.18 Apr 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-ux-infra_services - DEPRECATED DEPRECATED - Use Team:obs-presentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants